<template>
	<keep-alive>
	<view class="bac">
		<view class="" ref='indexClass'>
			
		</view>
	<view  class="zhuanzhang set_border" @touchend='end' v-for="item in consumeRecordLists" :key='item.id' >
		<view class="aside_top">
			<view class="left">当日产出：{{ item.mining_amount }}</view>
			<view class="right ">
			
				<!-- <text>-</text> -->

			{{` ${item.last_time.substr(4,2)}-${item.last_time.substr(6,2)} ${item.last_time.substr(8,2)}:${item.last_time.substr(10,2)}`}}
			</view>
		</view>
		<view class="aside_bot">
			<!--  -->
			<view class="date left">总产出：{{ item.total_mined }}</view>
	
		</view>
	</view>	
	</view>
	</keep-alive>
</template>

<script>
	export default {
		data(){
			return {
				consumeRecordLists:[],
				id:''
			}
		},
		onLoad( options ) {
			this.id  = options.id
		},
		onShow() {
			this.histroy()
		},
		methods:{
			end(e){
				  this.top  = this.$refs.indexClass.$el.getBoundingClientRect().top
					if(this.top > 0){
						uni.startPullDownRefresh({
							success: () => {
								window.location.reload()
							}
						});
					}
			},
			histroy (){
				this.$ajax(
				'bi/getMineMiningHistroy',
				{
					mmId:this.id
				},
				'POST'
				).then(res=>{
					this.consumeRecordLists = res.data
					console.log(this.consumeRecordLists )
				})
			}
		}
	}
</script>

<style scoped>
	page {
		background-color: #0E1B45;
	}
	
	.zhuanzhang {
		height: 140rpx;
	}
	
	.set_border {
		border-bottom: 1px solid #20D6D9;
		padding-left: 20upx;
	}
	.aside_top {
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		font-size: 30rpx;
		font-weight: 500;
		color: rgba(51, 51, 51, 1);
		padding-top: 29rpx;
	}
	.left{
		color: #FFF;
	}
	.right {
		margin-right: 23rpx;
		color: #FFF;
	}
	
	.date {
		margin-right: 10rpx;
	}
</style>
